package de.jmda.mview.fx.node.typeshape.relation;

import javafx.scene.Node;
import de.jmda.fx.node.ArrowOrthogonal;
import de.jmda.mview.fx.node.typeshape.FieldView;
import de.jmda.mview.fx.node.typeshape.Typeshape;
import de.jmda.mview.fx.node.typeshape.Typeshape.Anchor;

public abstract class RelationEndpoint
{
	/**
	 * Anchor point that connects a {@link Relation} with a {@link Typeshape}
	 * ({@link RelationEndpointSourceTypeBased} / {@link RelationEndpointTarget})
	 * or a {@link FieldView} ({@link RelationEndpointSourceFieldBased}). It
	 * defines the point where the relation touches the typeshape.
	 */
	protected Anchor anchorToTypeshape = new Anchor();

//	private final ObjectProperty<Point2D> anchor =
//			new SimpleObjectProperty<Point2D>();
//	public Point2D getAnchor() { return anchor.get(); }
//	protected void setAnchor(Point2D anchor) { this.anchor.set(anchor); }
//	protected ObjectProperty<Point2D> anchorProperty() { return anchor; }

	/**
	 * a relation endpoint node is represented by an orthogonal arrow
	 */
	protected ArrowOrthogonal arrow;

	public Node getNode()
	{
		return arrow;
	}
	
	public Anchor getAnchorToTypeshape()
  {
  	return anchorToTypeshape;
  }

	public ArrowOrthogonal getArrow()
  {
  	return arrow;
  }
}